package com.hopu.dy.controller;

import com.hopu.dy.entity.R;
import com.hopu.dy.pojo.video;
import com.hopu.dy.service.IDyService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController   //提供对象
@RequestMapping("Dy")   //区别路径
public class DyController {
    @Resource
    private IDyService dyService;

    /**
     * 获取所有评论
     *
     * @return 评论列表
     */
    @GetMapping
    public R getAllPingLun() {
        List<video> list=dyService.get();
        return R.ok(list);
    }

}
